<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <meta content='width=device-width, initial-scale=1.0' name='viewport'>
    <meta content='' name='description'>
    <meta content='Nils Nordman' name='author'>
    <link href='/images/howl.png' rel='shortcut icon'>
    <title>Howl :: Spec - howl.ui.Window</title>
    <link href="/stylesheets/bootstrap.min.css" media="screen" rel="stylesheet" type="text/css" />
    <link href="/stylesheets/syntax.css" media="screen" rel="stylesheet" type="text/css" />
    <link href="/stylesheets/howl.css" media="screen" rel="stylesheet" type="text/css" />
    <script src="https://code.jquery.com/jquery-1.12.3.min.js" type="text/javascript"></script>
    <script src="/javascripts/bootstrap.min.js" type="text/javascript"></script>
    
    <link href='//fonts.googleapis.com/css?family=Josefin+Slab' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Open+Sans+Condensed:700' rel='stylesheet' type='text/css'>
  </head>
  <body class='doc doc_spec doc_spec_ui doc_spec_ui_window_spec'>
    <div class='container'>
      <div class='masthead'>
        <ul class='nav nav-pills'>
          <li>
            <a href='/'>
              <span class='glyphicon glyphicon-home'></span>
              Home
            </a>
          </li>
          <li>
            <a href='/doc/'>
              <span class='glyphicon glyphicon-book'></span>
              Documentation
            </a>
          </li>
          <li>
            <a href='/blog/'>
              <span class='glyphicon glyphicon-bullhorn'></span>
              Blog
            </a>
          </li>
          <li>
            <a href='/contact.html'>
              <span class='glyphicon glyphicon-inbox'></span>
              Contact
            </a>
          </li>
        </ul>
      </div>
      <ol class="breadcrumb"><li><a href="/">Home</a></li><li><a href='../../'>Howl Documentation (master branch)</a></li><li>Spec</li><li>Ui</li><li>Spec - howl.ui.Window</li></ol>
      <div class="spec-group spec-group-1">&#x000A;&#x000A;<h1 id="howl.ui.window">howl.ui.Window</h1>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="kd">local</span><span class="w"> </span><span class="n">win</span><span class="w">&#x000A;&#x000A;</span><span class="n">before_each</span><span class="w"> </span><span class="o">-&gt;</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Window</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="o">\</span><span class="n">realize</span><span class="o">!</span></pre>&#x000A;<div class="spec-group spec-group-2">&#x000A;&#x000A;<h2 id="add_view">add_view<span class="arg-list">(view [, placement, anchor])</span></h2>&#x000A;&#x000A;<h4 id="adds-the-specified-view">adds the specified view</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Label</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">equals</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="o">#</span><span class="n">win</span><span class="p">.</span><span class="n">views</span></pre>&#x000A;&#x000A;<h4 id="returns-a-table-containing-x,-y,-width,-height-and-the-view">returns a table containing x, y, width, height and the view</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">label</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Label</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">label</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">label</span></pre>&#x000A;&#x000A;<h4 id="adds-the-new-view-to-the-right-of-the-currently-focused-one-by-default">adds the new view to the right of the currently focused one by default</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">entry</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">entry</span><span class="w">&#x000A;</span><span class="n">entry</span><span class="o">\</span><span class="n">grab_focus</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">label</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Label</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">label</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">label</span></pre>&#x000A;<div class="spec-group spec-group-3">&#x000A;&#x000A;<h3 id=""><span class="arg-list">(when placement is specified)</span></h3>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="kd">local</span><span class="w"> </span><span class="n">view</span><span class="p">,</span><span class="w"> </span><span class="n">entry</span><span class="w">&#x000A;&#x000A;</span><span class="n">before_each</span><span class="w"> </span><span class="o">-&gt;</span><span class="w">&#x000A;  </span><span class="n">entry</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">entry</span><span class="w">&#x000A;  </span><span class="n">entry</span><span class="o">\</span><span class="n">grab_focus</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">view</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span></pre>&#x000A;&#x000A;<h4 id="&quot;right_of&quot;-places-the-view-on-the-right-side-of-the-focused-child">&quot;right_of&quot; places the view on the right side of the focused child</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:view</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">view</span><span class="p">,</span><span class="w"> </span><span class="s1">'right_of'</span></pre>&#x000A;&#x000A;<h4 id="&quot;left_of&quot;-places-the-view-on-the-left-side-of-the-focused-child">&quot;left_of&quot; places the view on the left side of the focused child</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:view</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">view</span><span class="p">,</span><span class="w"> </span><span class="s1">'left_of'</span></pre>&#x000A;&#x000A;<h4 id="&quot;above&quot;-places-the-view-above-the-focused-child">&quot;above&quot; places the view above the focused child</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:view</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">view</span><span class="p">,</span><span class="w"> </span><span class="s1">'above'</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">entry</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">get_view</span><span class="w"> </span><span class="n">entry</span></pre>&#x000A;&#x000A;<h4 id="&quot;below&quot;-places-the-view-below-the-focused-child">&quot;below&quot; places the view below the focused child</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:view</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">view</span><span class="p">,</span><span class="w"> </span><span class="s1">'below'</span></pre>&#x000A;&#x000A;<h4 id="allows-specifying-the-relative-view-to-use-with-placement">allows specifying the relative view to use with placement</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">view</span><span class="p">,</span><span class="w"> </span><span class="s1">'below'</span><span class="w">&#x000A;</span><span class="n">next_view</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Label</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">next_view</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">next_view</span><span class="p">,</span><span class="w"> </span><span class="s1">'left_of'</span><span class="p">,</span><span class="w"> </span><span class="n">view</span></pre>&#x000A;&#x000A;<h4 id="creates-new-columns-as-needed">creates new columns as needed</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">view</span><span class="p">,</span><span class="w"> </span><span class="s1">'right_of'</span><span class="w">&#x000A;</span><span class="n">next_view</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Label</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">next_view</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">next_view</span><span class="p">,</span><span class="w"> </span><span class="s1">'left_of'</span><span class="p">,</span><span class="w"> </span><span class="n">view</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="p">[</span><span class="n">v</span><span class="p">.</span><span class="n">x</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">v</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="o">*</span><span class="n">win</span><span class="p">.</span><span class="n">views</span><span class="p">]</span></pre>&#x000A;</div>&#x000A;</div>&#x000A;<div class="spec-group spec-group-2">&#x000A;&#x000A;<h2 id="remove_view">remove_view<span class="arg-list">(view)</span></h2>&#x000A;&#x000A;<h4 id="removes-the-specified-view">removes the specified view</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">label</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Label</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">label</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">remove_view</span><span class="w"> </span><span class="n">label</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">equals</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="o">#</span><span class="n">win</span><span class="p">.</span><span class="n">views</span></pre>&#x000A;&#x000A;<h4 id="removes-the-currently-focused-child-if-view-is-nil">removes the currently focused child if view is nil</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">entry</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">entry</span><span class="w">&#x000A;</span><span class="n">entry</span><span class="o">\</span><span class="n">grab_focus</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">remove_view</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">equals</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="o">#</span><span class="n">win</span><span class="p">.</span><span class="n">views</span></pre>&#x000A;&#x000A;<h4 id="raises-an-error-if-view-is-nil-and-no-child-has-focus">raises an error if view is nil and no child has focus</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">label</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Label</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">label</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">raises</span><span class="w"> </span><span class="s1">'remove'</span><span class="p">,</span><span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">remove_view</span><span class="o">!</span></pre>&#x000A;&#x000A;<h4 id="set-focus-on-its-later-sibling-is-possible">set focus on its later sibling is possible</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">left</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">middle</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">right</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">middle</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">right</span><span class="w">&#x000A;</span><span class="n">middle</span><span class="o">\</span><span class="n">grab_focus</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">remove_view</span><span class="w"> </span><span class="n">middle</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">is_true</span><span class="w"> </span><span class="n">right</span><span class="p">.</span><span class="n">is_focus</span></pre>&#x000A;&#x000A;<h4 id="set-focus-on-its-earlier-sibling-if-no-later-sibling-exists">set focus on its earlier sibling if no later sibling exists</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">left</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">middle</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">right</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">middle</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">right</span><span class="w">&#x000A;</span><span class="n">right</span><span class="o">\</span><span class="n">grab_focus</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">remove_view</span><span class="w"> </span><span class="n">right</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">is_true</span><span class="w"> </span><span class="n">middle</span><span class="p">.</span><span class="n">is_focus</span></pre>&#x000A;</div>&#x000A;<div class="spec-group spec-group-2">&#x000A;&#x000A;<h2 id=".views">.views</h2>&#x000A;&#x000A;<h4 id="is-a-table-of-view-tables,-containing-x,-y-and-the-view-itself">is a table of view tables, containing x, y and the view itself</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">label</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Label</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">label</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">label</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="p">.</span><span class="n">views</span></pre>&#x000A;&#x000A;<h4 id="ordered-ascendingly">ordered ascendingly</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">entry</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">entry</span><span class="w">&#x000A;</span><span class="n">entry</span><span class="o">\</span><span class="n">grab_focus</span><span class="o">!</span><span class="w">&#x000A;&#x000A;</span><span class="n">l1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Label</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">l2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Label</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">l1</span><span class="p">,</span><span class="w"> </span><span class="s1">'left_of'</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">l2</span><span class="p">,</span><span class="w"> </span><span class="s1">'below'</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">l1</span><span class="p">,</span><span class="w"> </span><span class="n">entry</span><span class="p">,</span><span class="w"> </span><span class="n">l2</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="p">[</span><span class="n">v</span><span class="p">.</span><span class="n">view</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">v</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="o">*</span><span class="n">win</span><span class="p">.</span><span class="n">views</span><span class="p">]</span></pre>&#x000A;</div>&#x000A;<div class="spec-group spec-group-2">&#x000A;&#x000A;<h2 id=".current_view">.current_view</h2>&#x000A;&#x000A;<h4 id="is-nil-if-no-child-is-currently-focused">is nil if no child is currently focused</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">assert</span><span class="p">.</span><span class="n">is_nil</span><span class="p">,</span><span class="w"> </span><span class="n">win</span><span class="p">.</span><span class="n">current_view</span></pre>&#x000A;&#x000A;<h4 id="is-a-table-containing-x,-y-and-the-view-for-the-currently-focused-view">is a table containing x, y and the view for the currently focused view</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">e1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">e2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">e1</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">e2</span><span class="w">&#x000A;&#x000A;</span><span class="n">e1</span><span class="o">\</span><span class="n">grab_focus</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">e1</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="p">.</span><span class="n">current_view</span><span class="w">&#x000A;&#x000A;</span><span class="n">e2</span><span class="o">\</span><span class="n">grab_focus</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">e2</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="p">.</span><span class="n">current_view</span></pre>&#x000A;</div>&#x000A;<div class="spec-group spec-group-2">&#x000A;&#x000A;<h2 id="siblings">siblings<span class="arg-list">(view, wraparound)</span></h2>&#x000A;&#x000A;<h4 id="returns-an-empty-table-if-there-are-no-siblings">returns an empty table if there are no siblings</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">v1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">v1</span><span class="w">&#x000A;  </span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">siblings</span><span class="w"> </span><span class="n">v1</span></pre>&#x000A;&#x000A;<h4 id="defaults-to-the-currently-focused-child-if-view-is-not-provided">defaults to the currently focused child if view is not provided</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">v1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">v1</span><span class="w">&#x000A;  </span><span class="n">v1</span><span class="o">\</span><span class="n">grab_focus</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">siblings</span><span class="o">!</span></pre>&#x000A;&#x000A;<h4 id="returns-an-empty-table-if-view-is-not-provided-and-no-child-is-focused">returns an empty table if view is not provided and no child is focused</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">siblings</span><span class="o">!</span></pre>&#x000A;<div class="spec-group spec-group-3">&#x000A;&#x000A;<h3 id=""><span class="arg-list">(when wraparound is false)</span></h3>&#x000A;&#x000A;<h4 id="returns-a-table-of-siblings-for-the-specified-view-when-present">returns a table of siblings for the specified view when present</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">left</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A; </span><span class="n">right</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A; </span><span class="n">bottom</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A; </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A; </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">right</span><span class="p">,</span><span class="w"> </span><span class="s1">'right_of'</span><span class="p">,</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A; </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">bottom</span><span class="p">,</span><span class="w"> </span><span class="s1">'below'</span><span class="p">,</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A;&#x000A; </span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">right:</span><span class="w"> </span><span class="n">right</span><span class="p">,</span><span class="w"> </span><span class="ss">down:</span><span class="w"> </span><span class="n">bottom</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">siblings</span><span class="w"> </span><span class="n">left</span><span class="p">,</span><span class="w"> </span><span class="kc">false</span><span class="w">&#x000A; </span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">left:</span><span class="w"> </span><span class="n">left</span><span class="p">,</span><span class="w"> </span><span class="ss">down:</span><span class="w"> </span><span class="n">bottom</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">siblings</span><span class="w"> </span><span class="n">right</span><span class="p">,</span><span class="w"> </span><span class="kc">false</span><span class="w">&#x000A; </span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">up:</span><span class="w"> </span><span class="n">left</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">siblings</span><span class="w"> </span><span class="n">bottom</span><span class="p">,</span><span class="w"> </span><span class="kc">false</span></pre>&#x000A;</div>&#x000A;<div class="spec-group spec-group-3">&#x000A;&#x000A;<h3 id=""><span class="arg-list">(when wraparound is true)</span></h3>&#x000A;&#x000A;<h4 id="returns-a-table-of-siblings-for-the-specified-view-in-a-wraparound-fashion">returns a table of siblings for the specified view in a wraparound fashion</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">left</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">right</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">bottom</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">right</span><span class="p">,</span><span class="w"> </span><span class="s1">'right_of'</span><span class="p">,</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">bottom</span><span class="p">,</span><span class="w"> </span><span class="s1">'below'</span><span class="p">,</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A;&#x000A;  </span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">left:</span><span class="w"> </span><span class="n">bottom</span><span class="p">,</span><span class="w"> </span><span class="ss">right:</span><span class="w"> </span><span class="n">right</span><span class="p">,</span><span class="w"> </span><span class="ss">up:</span><span class="w"> </span><span class="n">bottom</span><span class="p">,</span><span class="w"> </span><span class="ss">down:</span><span class="w"> </span><span class="n">bottom</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">siblings</span><span class="w"> </span><span class="n">left</span><span class="p">,</span><span class="w"> </span><span class="kc">true</span><span class="w">&#x000A;  </span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">left:</span><span class="w"> </span><span class="n">left</span><span class="p">,</span><span class="w"> </span><span class="ss">right:</span><span class="w"> </span><span class="n">bottom</span><span class="p">,</span><span class="w"> </span><span class="ss">up:</span><span class="w"> </span><span class="n">bottom</span><span class="p">,</span><span class="w"> </span><span class="ss">down:</span><span class="w"> </span><span class="n">bottom</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">siblings</span><span class="w"> </span><span class="n">right</span><span class="p">,</span><span class="w"> </span><span class="kc">true</span><span class="w">&#x000A;  </span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">left:</span><span class="w"> </span><span class="n">right</span><span class="p">,</span><span class="w"> </span><span class="ss">right:</span><span class="w"> </span><span class="n">left</span><span class="p">,</span><span class="w"> </span><span class="ss">up:</span><span class="w"> </span><span class="n">left</span><span class="p">,</span><span class="w"> </span><span class="ss">down:</span><span class="w"> </span><span class="n">left</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">siblings</span><span class="w"> </span><span class="n">bottom</span><span class="p">,</span><span class="w"> </span><span class="kc">true</span></pre>&#x000A;</div>&#x000A;</div>&#x000A;<div class="spec-group spec-group-2">&#x000A;&#x000A;<h2 id="column-reflowing">column reflowing</h2>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="kd">local</span><span class="w"> </span><span class="n">left</span><span class="p">,</span><span class="w"> </span><span class="n">right</span><span class="p">,</span><span class="w"> </span><span class="n">bottom</span><span class="w">&#x000A;&#x000A;</span><span class="n">before_each</span><span class="w"> </span><span class="o">-&gt;</span><span class="w">&#x000A;  </span><span class="n">left</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">right</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">bottom</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">right</span><span class="w">&#x000A;  </span><span class="n">right</span><span class="o">\</span><span class="n">grab_focus</span><span class="o">!</span><span class="w">&#x000A;  </span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">bottom</span><span class="p">,</span><span class="w"> </span><span class="s1">'below'</span></pre>&#x000A;&#x000A;<h4 id="single-columns-as-expanded-as-necessary">single columns as expanded as necessary</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">bottom</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">get_view</span><span class="w"> </span><span class="n">bottom</span></pre>&#x000A;&#x000A;<h4 id="columns-to-the-right-are-adjusted-after-a-remove-of-a-left-column">columns to the right are adjusted after a remove of a left column</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">win</span><span class="o">\</span><span class="n">remove_view</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">right</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">get_view</span><span class="w"> </span><span class="n">right</span></pre>&#x000A;&#x000A;<h4 id="columns-to-the-left-are-adjusted-after-a-remove-of-a-right-column">columns to the left are adjusted after a remove of a right column</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">win</span><span class="o">\</span><span class="n">remove_view</span><span class="w"> </span><span class="n">right</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">left</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">get_view</span><span class="w"> </span><span class="n">left</span></pre>&#x000A;&#x000A;<h4 id="rows-are-adjusted-after-removal-of-a-middle-column">rows are adjusted after removal of a middle column</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">middle</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">middle</span><span class="p">,</span><span class="w"> </span><span class="s1">'right_of'</span><span class="p">,</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">remove_view</span><span class="w"> </span><span class="n">middle</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">left</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">get_view</span><span class="w"> </span><span class="n">left</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">same</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="ss">x:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">y:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">width:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">height:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">view:</span><span class="w"> </span><span class="n">right</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="n">win</span><span class="o">\</span><span class="n">get_view</span><span class="w"> </span><span class="n">right</span></pre>&#x000A;</div>&#x000A;<div class="spec-group spec-group-2">&#x000A;&#x000A;<h3 id=""><span class="arg-list">(resource management)</span></h3>&#x000A;&#x000A;<h4 id="added-views-are-not-anchored">added views are not anchored</h4>&#x000A;&#x000A;<pre class="highlight moonscript"><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Gtk</span><span class="p">.</span><span class="nc">Entry</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">views</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">setmetatable</span><span class="w"> </span><span class="p">{</span><span class="n">v</span><span class="p">},</span><span class="w"> </span><span class="ss">__mode:</span><span class="w"> </span><span class="s1">'v'</span><span class="w">&#x000A;</span><span class="n">win</span><span class="o">\</span><span class="n">add_view</span><span class="w"> </span><span class="n">v</span><span class="w">&#x000A;</span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">nil</span><span class="w">&#x000A;</span><span class="nb">collectgarbage</span><span class="o">!</span><span class="w">&#x000A;</span><span class="n">assert</span><span class="p">.</span><span class="n">is_nil</span><span class="w"> </span><span class="n">views</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span></pre>&#x000A;</div>&#x000A;</div>
      <div class='footer text-muted'>
        <a href='/'>
          <img width="50" height="50" class="footer-logo" src="/images/howl.png" />
        </a>
        <div class='footer-follow'>
          <p>
            <a class='twitter-follow-button' data-lang='en' data-show-count='false' href='https://twitter.com/howleditor' rel='me'>
              Follow @howleditor
            </a>
          </p>
          <p>
            <a class='twitter-share-button' data-count='none' data-hashtags='howleditor' data-lang='en' data-text='The Howl Editor, a general purpose, light-weight customizable editor.' data-url='http://howl.io' href='https://twitter.com/share'>
              Tweet
            </a>
          </p>
        </div>
        <div class='footer-blurb'>
          <div>The Howl editor.</div>
          <div>
            Copyright 2012-2016
            <a class='alert-link' href='https://github.com/howl-editor/howl/contributors'>
              The Howl Developers.
            </a>
          </div>
        </div>
      </div>
    </div>
    <script>
      <!-- / GA -->
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      ga('create', 'UA-45283282-1', 'howl.io');
      ga('send', 'pageview');
      <!-- / Twitter -->
      !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];
      if(!d.getElementById(id)){js=d.createElement(s);js.id=id;
      js.src="//platform.twitter.com/widgets.js";
      fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
    </script>
  </body>
</html>
